package com.bosssoft.itfinance.citizen.doc.controller.resp;

import java.util.List;

/**
 * Created by wangml on 2017/8/21.
 * 扫描后类对象
 */
public class ClassBean {
    private String clz;
    private String className;
    private List<MethodBean> methods;

    public String getClz() {
        return clz;
    }

    public void setClz(String clz) {
        this.clz = clz;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public List<MethodBean> getMethods() {
        return methods;
    }

    public void setMethods(List<MethodBean> methods) {
        this.methods = methods;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(this.className)
                .append(":")
                .append(this.clz)
                .append("\r\n");
        if(methods != null && methods.size() >0){
            for (MethodBean mb : this.methods){
                sb.append(mb.getMethodName()).append(mb.getPath()).append(":").append(mb.getShortResultType()).append(" ").append(mb.getMethod());
                if(mb.getParamBeanList() != null && mb.getParamBeanList().size() > 0){
                    List<ParamBean> paramBeans = mb.getParamBeanList();
                    sb.append("(");

                    int len = paramBeans.size();
                    for (int i=0;i<len;i++){
                        sb.append(paramBeans.get(i).getShortType());
                        if(i != (len - 1)) {
                            sb.append(",");
                        }
                    }
                    sb.append(")\r\n");
                }
            }
        }
        sb.append("\r\n");
        return sb.toString();
    }
}
